package map.infos;

import fileHandling.language.properties.ScenarioProps;
import logic.common.team.Fraction;
import logic.nodes.nodeSettings.Settings;
import map.SpaceBackground;

public class MapInfos extends Settings {
	
	public static final String SKYBOX_NAME = "SkyboxName";
	public static final String MAP_NAME = "ScenarioName";
	private SpaceBackground spaceBackground;
	
	public MapInfos(Settings settings) {
		super(settings);
	}
	
	public int getTime() { return Integer.valueOf(getValueOf(ScenarioProps.MaxTime)).intValue(); }
	
	public Fraction getFractionA() { return Fraction.getFraction(getValueOf(ScenarioProps.Team1)); }
	
	public Fraction getFractionB() { return Fraction.getFraction(getValueOf(ScenarioProps.Team2)); }
		
	public int getPilotMoney() { return Integer.valueOf(getValueOf(ScenarioProps.PilotMoney)).intValue(); }
	
	public SpaceBackground getSpaceBackground() {
		if(spaceBackground == null) 
			spaceBackground = new SpaceBackground(getSkyboxName(), getDimension());
		return spaceBackground;
	}
	
	public String getMapName() { return getValueOf(MAP_NAME); }
	
	public String getSkyboxName() { return getValueOf(SKYBOX_NAME); }
	
	public int getDimension() { return Integer.valueOf(getValueOf(ScenarioProps.Dimension)).intValue(); }
}